﻿<?php
require 'cle_encrypt.php';
require 'config_bd.php';

$uname = $_REQUEST["name"];
$upass = $_REQUEST["pass"];

$sql = " update t001_users " . 
	   " set password = AES_ENCRYPT('nouveau' ,:cle_encrypt)";
	
try {

    $dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
	$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$stmt = $dbh->prepare($sql);  
	$stmt->bindParam("cle_encrypt", $cle_encrypt);
	$stmt->execute();
	
    echo 'le nouveau mot de passe est en force pour tous les usagers';

	$dbh = null;

}
catch(PDOException $e) {

    echo $e->getMessage(); 

}
?>
